#ifndef DOWNLOADLISTWIDGETS_H
#define DOWNLOADLISTWIDGETS_H

#include <QListWidget>

class DownloadUnits;

class DownloadListWidgets : public QListWidget
{
    Q_OBJECT
public:
    explicit DownloadListWidgets(QWidget *parent = 0);
    ~DownloadListWidgets();

signals:
    void downloadStateChanged(bool&);

public slots:
    void itemDoubleClickedPressed(QListWidgetItem*);
    void itemClickedPressed(QListWidgetItem*);
    void addItemToList(const QString& path);
    void addItemToList(const QStringList& path);
    void deleteItemFromList();
    void pause();
    void start();
    void downloadingFinished(const QString &);

protected:
    void clearItems();
    void setTransparent(int angle);
    void stateChanged();
    int getIndexFromUrl(const QString &);
    void getTopUrlToDownload();

    QList<DownloadUnits*> m_itemList;
    QStringList m_urls;
    QStringList m_downloadQueue;
    int m_maxDownloadCount;

};

#endif // DOWNLOADLISTWIDGETS_H
